#include "sysset.h"
#include "ui_sysset.h"
#include "mainWidget.h"

SysSet::SysSet(QWidget *parent) :
    QWidget(parent),
    ui(new Ui::SysSet)
{
    ui->setupUi(this);

    pWidget = static_cast<Widget*>(parent);

    ui->stackedWidget->setCurrentIndex(ArmSet_id);

    //返回设置子界面
    connect(ui->Btn_back, &QPushButton::clicked, this, [=](){
        pWidget->backSetPage();
    });

    connect(ui->Btn_armSet, &QPushButton::clicked, this, [=](){
        ui->stackedWidget->setCurrentIndex(ArmSet_id);
        ui->Btn_save->show();
    });
    connect(ui->Btn_axisParaSet, &QPushButton::clicked, this, [=](){
        ui->stackedWidget->setCurrentIndex(AxisParaSet_id);
        ui->Btn_save->show();
    });
    connect(ui->Btn_valueParaSet, &QPushButton::clicked, this, [=](){
        ui->stackedWidget->setCurrentIndex(ValParaSet_id);
        ui->Btn_save->show();
    });
    connect(ui->Btn_userVarSet, &QPushButton::clicked, this, [=](){
        ui->stackedWidget->setCurrentIndex(UserVarSet_id);
        ui->Btn_save->show();
    });
    connect(ui->Btn_coordSet, &QPushButton::clicked, this, [=](){
        ui->stackedWidget->setCurrentIndex(CoordSet_id);
        ui->Btn_save->hide();
    });
}

SysSet::~SysSet()
{
    delete ui;
}
